<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="TProjectBasic" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
    <typeAlias alias="TProjectBasic" type="EIA.PM.Model.TProjectBasic, EIA.PM.Model" />
</alias>

<resultMaps>
<resultMap id="select-tprojectbasic-result" class="TProjectBasic">
<constructor>
    <argument argumentName="prj_id" column="prj_id"/>
    <argument argumentName="prj_name" column="prj_name"/>
    <argument argumentName="prj_type" column="prj_type"/>
    <argument argumentName="prj_cons_org" column="prj_cons_org"/>
    <argument argumentName="prj_region" column="prj_region"/>
    <argument argumentName="prj_approve_gov" column="prj_approve_gov"/>
    <argument argumentName="prj_industry" column="prj_industry"/>
    <argument argumentName="prj_source" column="prj_source"/>
    <argument argumentName="prj_engineer" column="prj_engineer"/>
    <argument argumentName="prj_engineer_name" column="prj_engineer_name"/>
    <argument argumentName="prj_contact" column="prj_contact"/>
    <argument argumentName="prj_contact_tel" column="prj_contact_tel"/>
    <argument argumentName="prj_coop_org" column="prj_coop_org"/>
    <argument argumentName="prj_coop_fee" column="prj_coop_fee"/>
    <argument argumentName="prj_cost" column="prj_cost"/>
    <argument argumentName="prj_doc_no" column="prj_doc_no"/>
    <argument argumentName="prj_leader" column="prj_leader"/>
    <argument argumentName="prj_leader_name" column="prj_leader_name"/>
    <argument argumentName="prj_scheduled" column="prj_scheduled"/>
    <argument argumentName="prj_begin_date" column="prj_begin_date"/>
    <argument argumentName="_progress" column="_progress"/>
    <argument argumentName="_contract" column="_contract"/>
    <argument argumentName="_filed" column="_filed"/>
    <argument argumentName="_invoice" column="_invoice"/>
    <argument argumentName="_receipt" column="_receipt"/>
    <argument argumentName="_bonus_apply" column="_bonus_apply"/>
    <argument argumentName="_date" column="_date"/>
    <argument argumentName="_staff" column="_staff"/>
</constructor>
<!--
    <result property="PrjId" column="prj_id"/>
    <result property="PrjName" column="prj_name"/>
    <result property="PrjType" column="prj_type"/>
    <result property="PrjConsOrg" column="prj_cons_org"/>
    <result property="PrjRegion" column="prj_region"/>
    <result property="PrjApproveGov" column="prj_approve_gov"/>
    <result property="PrjIndustry" column="prj_industry"/>
    <result property="PrjSource" column="prj_source"/>
    <result property="PrjEngineer" column="prj_engineer"/>
    <result property="PrjEngineerName" column="prj_engineer_name"/>
    <result property="PrjContact" column="prj_contact"/>
    <result property="PrjContactTel" column="prj_contact_tel"/>
    <result property="PrjCoopOrg" column="prj_coop_org"/>
    <result property="PrjCoopFee" column="prj_coop_fee"/>
    <result property="PrjCost" column="prj_cost"/>
    <result property="PrjDocNo" column="prj_doc_no"/>
    <result property="PrjLeader" column="prj_leader"/>
    <result property="PrjLeaderName" column="prj_leader_name"/>
    <result property="PrjScheduled" column="prj_scheduled"/>
    <result property="PrjBeginDate" column="prj_begin_date"/>
    <result property="Progress" column="_progress"/>
    <result property="Contract" column="_contract"/>
    <result property="Filed" column="_filed"/>
    <result property="Invoice" column="_invoice"/>
    <result property="Receipt" column="_receipt"/>
    <result property="BonusApply" column="_bonus_apply"/>
    <result property="Date" column="_date"/>
    <result property="Staff" column="_staff"/>
-->
</resultMap>
</resultMaps>

<statements>
<sql id="sql_TProjectBasic_where_pk">
WHERE prj_id=#PrjId#
</sql>

<sql id="sql_TProjectBasic_where_cv">
<dynamic prepend="WHERE">
    <isPropertyAvailable property="PrjId" prepend="AND">prj_id=#PrjId#</isPropertyAvailable>
    <isPropertyAvailable property="PrjName" prepend="AND">prj_name LIKE concat('%', #PrjName#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjType" prepend="AND">prj_type=#PrjType#</isPropertyAvailable>
    <isPropertyAvailable property="PrjConsOrg" prepend="AND">prj_cons_org LIKE concat('%', #PrjConsOrg#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjRegion" prepend="AND">prj_region=#PrjRegion#</isPropertyAvailable>
    <isPropertyAvailable property="PrjApproveGov" prepend="AND">prj_approve_gov=#PrjApproveGov#</isPropertyAvailable>
    <isPropertyAvailable property="PrjIndustry" prepend="AND">prj_industry=#PrjIndustry#</isPropertyAvailable>
    <isPropertyAvailable property="PrjSource" prepend="AND">prj_source=#PrjSource#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineer" prepend="AND">prj_engineer=#PrjEngineer#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineerName" prepend="AND">prj_engineer_name LIKE concat('%', #PrjEngineerName#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjContact" prepend="AND">prj_contact LIKE concat('%', #PrjContact#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjContactTel" prepend="AND">prj_contact_tel LIKE concat('%', #PrjContactTel#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopOrg" prepend="AND">prj_coop_org LIKE concat('%', #PrjCoopOrg#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopFee" prepend="AND">prj_coop_fee=#PrjCoopFee#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCost" prepend="AND">prj_cost=#PrjCost#</isPropertyAvailable>
    <isPropertyAvailable property="PrjDocNo" prepend="AND">prj_doc_no LIKE concat('%', #PrjDocNo#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeader" prepend="AND">prj_leader=#PrjLeader#</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeaderName" prepend="AND">prj_leader_name LIKE concat('%', #PrjLeaderName#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="PrjScheduled" prepend="AND">prj_scheduled=#PrjScheduled#</isPropertyAvailable>
    <isPropertyAvailable property="PrjBeginDate" prepend="AND">prj_begin_date=#PrjBeginDate#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend="AND">_progress=#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="Contract" prepend="AND">_contract=#Contract#</isPropertyAvailable>
    <isPropertyAvailable property="Filed" prepend="AND">_filed=#Filed#</isPropertyAvailable>
    <isPropertyAvailable property="Invoice" prepend="AND">_invoice=#Invoice#</isPropertyAvailable>
    <isPropertyAvailable property="Receipt" prepend="AND">_receipt=#Receipt#</isPropertyAvailable>
    <isPropertyAvailable property="BonusApply" prepend="AND">_bonus_apply=#BonusApply#</isPropertyAvailable>
    <isPropertyAvailable property="Date" prepend="AND">_date=#Date#</isPropertyAvailable>
    <isPropertyAvailable property="Staff" prepend="AND">_staff=#Staff#</isPropertyAvailable>
</dynamic>
</sql>

<sql id="sql_TProjectBasic_set_cols">
<dynamic prepend="SET">
    <isPropertyAvailable property="PrjName" prepend=",">prj_name=#PrjName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjType" prepend=",">prj_type=#PrjType#</isPropertyAvailable>
    <isPropertyAvailable property="PrjConsOrg" prepend=",">prj_cons_org=#PrjConsOrg#</isPropertyAvailable>
    <isPropertyAvailable property="PrjRegion" prepend=",">prj_region=#PrjRegion#</isPropertyAvailable>
    <isPropertyAvailable property="PrjApproveGov" prepend=",">prj_approve_gov=#PrjApproveGov#</isPropertyAvailable>
    <isPropertyAvailable property="PrjIndustry" prepend=",">prj_industry=#PrjIndustry#</isPropertyAvailable>
    <isPropertyAvailable property="PrjSource" prepend=",">prj_source=#PrjSource#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineer" prepend=",">prj_engineer=#PrjEngineer#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineerName" prepend=",">prj_engineer_name=#PrjEngineerName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjContact" prepend=",">prj_contact=#PrjContact#</isPropertyAvailable>
    <isPropertyAvailable property="PrjContactTel" prepend=",">prj_contact_tel=#PrjContactTel#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopOrg" prepend=",">prj_coop_org=#PrjCoopOrg#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopFee" prepend=",">prj_coop_fee=#PrjCoopFee#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCost" prepend=",">prj_cost=#PrjCost#</isPropertyAvailable>
    <isPropertyAvailable property="PrjDocNo" prepend=",">prj_doc_no=#PrjDocNo#</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeader" prepend=",">prj_leader=#PrjLeader#</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeaderName" prepend=",">prj_leader_name=#PrjLeaderName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjScheduled" prepend=",">prj_scheduled=#PrjScheduled#</isPropertyAvailable>
    <isPropertyAvailable property="PrjBeginDate" prepend=",">prj_begin_date=#PrjBeginDate#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">_progress=#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="Contract" prepend=",">_contract=#Contract#</isPropertyAvailable>
    <isPropertyAvailable property="Filed" prepend=",">_filed=#Filed#</isPropertyAvailable>
    <isPropertyAvailable property="Invoice" prepend=",">_invoice=#Invoice#</isPropertyAvailable>
    <isPropertyAvailable property="Receipt" prepend=",">_receipt=#Receipt#</isPropertyAvailable>
    <isPropertyAvailable property="BonusApply" prepend=",">_bonus_apply=#BonusApply#</isPropertyAvailable>
    <isPropertyAvailable property="Date" prepend=",">_date=#Date#</isPropertyAvailable>
    <isPropertyAvailable property="Staff" prepend=",">_staff=#Staff#</isPropertyAvailable>
</dynamic>
</sql>

<select id="SelectTProjectBasic" parameterClass="" resultMap="TProjectBasic.select-tprojectbasic-result">
SELECT *
FROM t_project_basic
<include refid="sql_TProjectBasic_where_pk"/><!--where-->
</select>

<select id="SelectTProjectBasic_CV" parameterClass="System.Collections.IDictionary" resultMap="TProjectBasic.select-tprojectbasic-result">
SELECT *
FROM t_project_basic
<include refid="sql_TProjectBasic_where_cv"/><!--where-->
</select>

<insert id="InsertTProjectBasic" parameterClass="TProjectBasic">
<!--pre selectKey place-->
INSERT INTO t_project_basic(
<dynamic prepend=" ">
    <isPropertyAvailable property="PrjName" prepend=",">prj_name</isPropertyAvailable>
    <isPropertyAvailable property="PrjType" prepend=",">prj_type</isPropertyAvailable>
    <isPropertyAvailable property="PrjConsOrg" prepend=",">prj_cons_org</isPropertyAvailable>
    <isPropertyAvailable property="PrjRegion" prepend=",">prj_region</isPropertyAvailable>
    <isPropertyAvailable property="PrjApproveGov" prepend=",">prj_approve_gov</isPropertyAvailable>
    <isPropertyAvailable property="PrjIndustry" prepend=",">prj_industry</isPropertyAvailable>
    <isPropertyAvailable property="PrjSource" prepend=",">prj_source</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineer" prepend=",">prj_engineer</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineerName" prepend=",">prj_engineer_name</isPropertyAvailable>
    <isPropertyAvailable property="PrjContact" prepend=",">prj_contact</isPropertyAvailable>
    <isPropertyAvailable property="PrjContactTel" prepend=",">prj_contact_tel</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopOrg" prepend=",">prj_coop_org</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopFee" prepend=",">prj_coop_fee</isPropertyAvailable>
    <isPropertyAvailable property="PrjCost" prepend=",">prj_cost</isPropertyAvailable>
    <isPropertyAvailable property="PrjDocNo" prepend=",">prj_doc_no</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeader" prepend=",">prj_leader</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeaderName" prepend=",">prj_leader_name</isPropertyAvailable>
    <isPropertyAvailable property="PrjScheduled" prepend=",">prj_scheduled</isPropertyAvailable>
    <isPropertyAvailable property="PrjBeginDate" prepend=",">prj_begin_date</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">_progress</isPropertyAvailable>
    <isPropertyAvailable property="Contract" prepend=",">_contract</isPropertyAvailable>
    <isPropertyAvailable property="Filed" prepend=",">_filed</isPropertyAvailable>
    <isPropertyAvailable property="Invoice" prepend=",">_invoice</isPropertyAvailable>
    <isPropertyAvailable property="Receipt" prepend=",">_receipt</isPropertyAvailable>
    <isPropertyAvailable property="BonusApply" prepend=",">_bonus_apply</isPropertyAvailable>
    <isPropertyAvailable property="Date" prepend=",">_date</isPropertyAvailable>
    <isPropertyAvailable property="Staff" prepend=",">_staff</isPropertyAvailable>
</dynamic>
)VALUES(
<dynamic prepend=" ">
    <isPropertyAvailable property="PrjName" prepend=",">#PrjName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjType" prepend=",">#PrjType#</isPropertyAvailable>
    <isPropertyAvailable property="PrjConsOrg" prepend=",">#PrjConsOrg#</isPropertyAvailable>
    <isPropertyAvailable property="PrjRegion" prepend=",">#PrjRegion#</isPropertyAvailable>
    <isPropertyAvailable property="PrjApproveGov" prepend=",">#PrjApproveGov#</isPropertyAvailable>
    <isPropertyAvailable property="PrjIndustry" prepend=",">#PrjIndustry#</isPropertyAvailable>
    <isPropertyAvailable property="PrjSource" prepend=",">#PrjSource#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineer" prepend=",">#PrjEngineer#</isPropertyAvailable>
    <isPropertyAvailable property="PrjEngineerName" prepend=",">#PrjEngineerName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjContact" prepend=",">#PrjContact#</isPropertyAvailable>
    <isPropertyAvailable property="PrjContactTel" prepend=",">#PrjContactTel#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopOrg" prepend=",">#PrjCoopOrg#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCoopFee" prepend=",">#PrjCoopFee#</isPropertyAvailable>
    <isPropertyAvailable property="PrjCost" prepend=",">#PrjCost#</isPropertyAvailable>
    <isPropertyAvailable property="PrjDocNo" prepend=",">#PrjDocNo#</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeader" prepend=",">#PrjLeader#</isPropertyAvailable>
    <isPropertyAvailable property="PrjLeaderName" prepend=",">#PrjLeaderName#</isPropertyAvailable>
    <isPropertyAvailable property="PrjScheduled" prepend=",">#PrjScheduled#</isPropertyAvailable>
    <isPropertyAvailable property="PrjBeginDate" prepend=",">#PrjBeginDate#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="Contract" prepend=",">#Contract#</isPropertyAvailable>
    <isPropertyAvailable property="Filed" prepend=",">#Filed#</isPropertyAvailable>
    <isPropertyAvailable property="Invoice" prepend=",">#Invoice#</isPropertyAvailable>
    <isPropertyAvailable property="Receipt" prepend=",">#Receipt#</isPropertyAvailable>
    <isPropertyAvailable property="BonusApply" prepend=",">#BonusApply#</isPropertyAvailable>
    <isPropertyAvailable property="Date" prepend=",">#Date#</isPropertyAvailable>
    <isPropertyAvailable property="Staff" prepend=",">#Staff#</isPropertyAvailable>
</dynamic>
)
<selectKey resultClass="int" type="post" property="PrjId" >
SELECT LAST_INSERT_ID()
</selectKey>
</insert>

<update id="UpdateTProjectBasic" parameterClass="System.Collections.IDictionary">
UPDATE t_project_basic
<include refid="sql_TProjectBasic_set_cols"/><!--set-->
<include refid="sql_TProjectBasic_where_pk"/><!--where-->
</update>

<delete id="DeleteTProjectBasic" parameterClass="">
DELETE FROM t_project_basic
<include refid="sql_TProjectBasic_where_pk"/><!--where-->
</delete>

<statement id="DeleteTProjectBasic_CV" parameterClass="TProjectBasic">
DELETE FROM t_project_basic
<include refid="sql_TProjectBasic_where_cv"/><!--where-->
</statement>

<delete id="ClearTProjectBasic">
DELETE FROM t_project_basic
</delete>
</statements>
</sqlMap>